
cmake_minimum_required(VERSION 3.10)
project(demo5)

set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets Core)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets Core)
find_package(OpenCASCADE REQUIRED)

include_directories(${OpenCASCADE_INCLUDE_DIR})

link_directories(${OpenCASCADE_BINARY_DIR})

file(GLOB GUI_LIB_LISTS ${OpenCASCADE_BINARY_DIR}/*.dll)
file(GLOB GUI_SOURCE_LISTS "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
file(GLOB GUI_INCLUDE_LISTS "${CMAKE_CURRENT_SOURCE_DIR}/*.h**")
file(GLOB GUI_GUIFILE_LISTS "${CMAKE_CURRENT_SOURCE_DIR}/*.ui")

set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/bin")
add_executable(demo5 ${GUI_SOURCE_LISTS} ${GUI_INCLUDE_LISTS} ${GUI_GUIFILE_LISTS})
target_link_libraries(demo5 PRIVATE Qt${QT_VERSION_MAJOR}::Widgets ${GUI_LIB_LISTS})
